$(function(){
//自适应移动端比例
function rem(size){
    var clientW=document.documentElement.clientWidth;
    var bili=clientW/size;
    var fontSize=bili*100;
    document.getElementsByTagName("html")[0].style.fontSize=fontSize+"px"
}
rem(750);
/********************************/
$("body").append("<img src='"+PUBLIC+"/gold/img/forget_password/bz.png' class='logo animated bounceInDown'/>")
$("body").append("<div class='loginBox'><div>")
$("body").append("<div class='shade'><div>")
$(".shade").append("<div class='alertBox animated'><div>")
$(".alertBox").append("<div class='alertsubmit'><div>")
$(".alertBox").append("<p></p>")
$(".alertBox").append("<img src='"+PUBLIC+"/gold/img/forget_password/xm.png' alt='' class='animated infinite'/>")
$(".loginBox").append("<form action=''></form>")
$(".loginBox").append("<a href='javascript:;'>发送验证码</a>")
$(".loginBox").append("<a href='javascript:;'></a>")
$(".loginBox form").append("<input type='tel' placeholder='请输入手机号'/>")
$(".loginBox form").append("<input type='number' placeholder='验证码'/>")
$(".loginBox form").append("<input type='password' placeholder='请输入新密码'/>")
$(".loginBox form").append("<div class='submit'></div>")
$(".loginBox form").append("<div class='fanhui'></div>")
function login(){
	this.btn=$(".submit")[0];
	this.btn1=$(".fanhui")[0];
	this.shade=$(".shade")[0]
	this.btnClose=$(".alertsubmit")[0]
	this.yanzhengma=$(".loginBox a:nth-of-type(1)")[0]
}
login.prototype={
	btns:function(){
		var that=this;
		that.btn.addEventListener("touchstart",function(e){
            e.preventDefault();
            that.btn.style.background="url("+PUBLIC+"/gold/img/forget_password/qr2.png)";
            that.btn.style.backgroundSize="cover";
       	},false);
       	that.btn.addEventListener("touchend",function(e){
            e.preventDefault();
            that.btn.style.background="url("+PUBLIC+"/gold/img/forget_password/qr.png)";
            that.btn.style.backgroundSize="cover";
            that.shade.style.display="block"
            $(".alertBox").addClass("bounceInLeft")
            $(".alertBox img").addClass("rubberBand")
            setTimeout(function(){
        		$(".alertBox").removeClass("bounceInLeft");
    		}, 1000);
            var val=$(".loginBox input:nth-of-type(1)").val();
            if(val == ""){
            	$(".alertBox p").html("请输入手机号！")
            }else{
            	$(".alertBox p").html("修改成功！")
            	setTimeout(function(){
            		window.location.href="login.html"
            	},1000);
            }
            //else if继续验证
       	},false);
	},
	btns1:function(){
		var that=this;
		that.btn1.addEventListener("touchstart",function(e){
            e.preventDefault();
            that.btn1.style.background="url("+PUBLIC+"/gold/img/forget_password/9.png)";
            that.btn1.style.backgroundSize="cover";
       	},false);
       	that.btn1.addEventListener("touchend",function(e){
            e.preventDefault();
            that.btn1.style.background="url("+PUBLIC+"/gold/img/forget_password/8.png)";
            that.btn1.style.backgroundSize="cover";
            window.history.go(-1);
       	},false);
	},
	init:function(){
		var that=this;
		that.btns();
		that.btns1();
		that.close();
		that.clock();
	},
	close:function(){
		var that=this;
		that.btnClose.addEventListener("touchstart",function(e){
            e.preventDefault();
            that.btnClose.style.background="url("+PUBLIC+"/gold/img/forget_password/qd2.png)";
            that.btnClose.style.backgroundSize="cover";
       	},false);
       	that.btnClose.addEventListener("touchend",function(e){
            e.preventDefault();
            that.btnClose.style.background="url("+PUBLIC+"/gold/img/forget_password/qd.png)";
            that.btnClose.style.backgroundSize="cover";
            $(".alertBox").addClass("bounceOutRight");
            setTimeout(function(){
        		$(".alertBox").removeClass("bounceOutRight");
        		that.shade.style.display="none";
    		}, 500);
       	},false);
	},
	clock:function(){
		var that=this;
		that.yanzhengma.addEventListener("touchstart",function(e){
            e.preventDefault();
       	},false);
       	that.yanzhengma.addEventListener("touchend",function(e){
            e.preventDefault();
            alert("发送验证码")
       	},false);
	}
}
var loginHtml=new login();
loginHtml.init();
/*
 * 
 */
})